package com.aispace.taichu.modules.dynamic.model.controller;

import com.aispace.taichu.modules.agent.llm.LLMService;
import com.aispace.taichu.response.ResponseResult;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@AllArgsConstructor
@RequestMapping("/test")
public class TestController {

    private final LLMService llmService;

    @GetMapping("/chat")
    public ResponseResult<String> chat(@RequestParam String question) {
        String content = llmService.getDefaultChatClient().prompt(question).call().content();
        return ResponseResult.success(content);
    }

}
